<?php
require 'include/global.php';
require_once 'include/train_db.php';
include("include/HOP.php");

$smarty->compile_check = true;
$utype = $_GET[utype];
$uname = $_GET[uname];
if(!empty($_SESSION[usertype])) $utype = $_SESSION[usertype];
if(!empty($_SESSION[uname])) $uname = $_SESSION[uname];

if($utype=='employer'){
 $itemname = "Employer";
 $pay = "29.95";
 $title    = "Employer $29.95/month 90 days free";
 $sql = "SELECT * FROM pa_employer WHERE ep_uname = '".$uname."'";
 $rss =  $DB->fetch_one_array($sql);
 $firstname = $rss[ep_fname];
 $lastname  = $rss[ep_lname];
 $location  = $rss[ep_address1];
 $city      = $rss[ep_city];
 $state     = $state[$rss[ep_state]];
 $zip       = $rss[ep_zip];
 $country   = "US";
 $phone     = $rss[ep_phone];
 $email     = $rss[ep_email];
 $comments  = "Employer membership"  ;
 $myfield   = $rss[ep_id]."|employer";
 $toptitle  = "Checkout";
}
if($utype=='recruiter'){
 $itemname = "Recruiter";
 $pay = "19.95";
 //$title = "Recruiter $19.95/month 90 days free";
 $title = "You are purchasing a membership with enetRecruiter.  Recruiter membership fee is $29.95 per month.  <br /><br />
			We currently accept VISA, MasterCard, American Express, and Discover Card.  Your credit card payment will be processed directly through Bank of America and Cybersource's Secure Online System.  Please have your credit card ready before continuing. <br />
			";
 $sql = "SELECT * FROM pa_recuiter WHERE rc_uname = '".$uname."'";
 $rss =  $DB->fetch_one_array($sql);
 $firstname = $rss[rc_fname];
 $lastname  = $rss[rc_lname];
 $location  = $rss[rc_address1];
 $city      = $rss[rc_city];
 $state     = $state[$rss[rc_state]];
 $zip       = $rss[rc_zip];
 $country   = "US";
 $phone     = $rss[rc_phone];
 $email     = $rss[rc_email];
 $comments  = "Recruiter membership"  ;
 $myfield   = $rss[rc_id]."|recruiter";
 $toptitle  = "Membership Purchase";
}

if($utype=='candidate'){
 $itemname = "Candidate";
 $pay      = "2.75";
 $title    = "Candidate $2.75/month 30 days free";
 $sql      = "SELECT * FROM pa_candidates WHERE js_uname = '".$uname."'";
 $rss      =  $DB->fetch_one_array($sql);
 $firstname = $rss[js_fname];
 $lastname  = $rss[js_lname];
 $location  = $rss[js_address1];
 $city      = $rss[js_city];
 $zip       = $rss[js_zip];
 $state     = $state[$rss[js_state]];
 $country   = "US";
 $phone     = $rss[js_phone];
 $email     = $rss[js_email];
 $comments  = "Candidate membership"  ;
 $myfield   = $rss[js_id]."|candidate";
 $toptitle  = "Checkout";
}

if($utype=='advisor'){
 $itemname = "Advisor";
 $pay      = "11.95";
 $title    = "You are purchasing a membership with enetRecruiter.  Advisor membership fee is $11.95 per month.<br /><br />  
				We currently accept VISA, MasterCard, American Express, and Discover Card.  Your credit card payment will be processed directly through Bank of America and Cybersource's Secure Online System.  Please have your credit card ready before continuing.  <br /><br />
				";
 $sql      = "SELECT * FROM pa_advisory  WHERE ad_uname = '".$uname."'";
 $rss      =  $DB->fetch_one_array($sql);
 $firstname = $rss[ad_fname];
 $lastname  = $rss[ad_lname];
 $location  = $rss[ad_address];
 $city      = $rss[ad_city];
 $zip       = $rss[ad_zip];
 $state     = $state[$rss[ad_state]];
 $country   = "US";
 $phone     = $rss[ad_phone];
 $email     = $rss[ad_email];
 $comments  = "Advisor membership"  ;
 $myfield   = $rss[ad_id]."|advisor";
 $toptitle  = "Membership Purchase";
}

$overdue = (!empty($_SESSION['status']))?$_SESSION['status']:"Trial";

if($overdue=="Trial"){
   $overduemessage = "Account status is <b>Trial</b>. You have not expired, but you can buy this service yet!";
}

if($overdue=="Expired"){
   $overduemessage = "Account status now <b>Expired</b>!";
}

$smarty->assign("firstname",$firstname);
$smarty->assign("lastname",$lastname);
$smarty->assign("location",$location);
$smarty->assign("city",$city);
$smarty->assign("state",$state);
$smarty->assign("country",$country);
$smarty->assign("zip",$zip);
$smarty->assign("phone",$phone);
$smarty->assign("email",$email);
$smarty->assign("cbk",InsertSignature3("$pay","USD","subscription"));
$smarty->assign("subscription",InsertSubscriptionSignature($pay, 
    date('Ymd'), 
    'monthly', 
    '12',
    'false'));
$smarty->assign("title",$title);
$smarty->assign("toptitle",$toptitle);
$smarty->assign("comments",$comments);
$smarty->assign("myfield",$myfield);
$smarty->assign("overdue",$overdue);
$smarty->assign("overduemessage",$overduemessage);


$smarty->display('header.tpl');
$smarty->display('left.tpl');
$smarty->display('cybersource.tpl');
$smarty->display('right.tpl');
$smarty->display('footer.tpl');
?>
